///*
// * Copyright The OpenTelemetry Authors
// * SPDX-License-Identifier: Apache-2.0
// */
//
//package com.xiashitech.agent.instrumentation.netty.netty_v4_common.server;
//
//import com.xiashitech.agent.instrumentation.netty.netty_common.NettyErrorHolder;
//import com.xiashitech.agent.instrumentation.netty.netty_v4_common.HttpRequestAndChannel;
//import io.netty.handler.codec.http.HttpResponse;
//import io.opentelemetry.javaagent.bootstrap.internal.CommonConfig;
//import io.opentelemetry.javaagent.shaded.instrumentation.api.instrumenter.Instrumenter;
//import io.opentelemetry.javaagent.shaded.instrumentation.api.instrumenter.http.*;
//import io.opentelemetry.javaagent.shaded.instrumentation.api.instrumenter.net.NetServerAttributesExtractor;
//import io.opentelemetry.javaagent.shaded.io.opentelemetry.api.GlobalOpenTelemetry;
//
//
//public final class NettyServerInstrumenterFactory {
//
//  public static Instrumenter<HttpRequestAndChannel, HttpResponse> create(
//          String instrumentationName) {
//
//    NettyHttpServerAttributesGetter httpAttributesGetter = new NettyHttpServerAttributesGetter();
//
//    return Instrumenter.<HttpRequestAndChannel, HttpResponse>builder(
//                    GlobalOpenTelemetry.get(),
//                    instrumentationName,
//                    HttpSpanNameExtractor.create(httpAttributesGetter))
//            .setSpanStatusExtractor(HttpSpanStatusExtractor.create(httpAttributesGetter))
//            .addAttributesExtractor(
//                    HttpServerAttributesExtractor.builder(httpAttributesGetter)
//                            .setCapturedRequestHeaders(CommonConfig.get().getServerRequestHeaders())
//                            .setCapturedResponseHeaders(CommonConfig.get().getServerResponseHeaders())
//                            .build())
//            .addAttributesExtractor(
//                    NetServerAttributesExtractor.create(new NettyNetServerAttributesGetter()))
//            .addOperationMetrics(HttpServerMetrics.get())
//            .addContextCustomizer((context, request, attributes) -> NettyErrorHolder.init(context))
//            .addContextCustomizer(HttpRouteHolder.get())
//            .buildServerInstrumenter(HttpRequestHeadersGetter.INSTANCE);
//  }
//
//  private NettyServerInstrumenterFactory() {}
//}
